package cn.com.thinker.core.module.dao.mapper;


import cn.com.thinker.core.module.entity.User;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 *
 * User 表数据库控制层接口
 *
 */
@CacheConfig(cacheNames = "user")
@Repository("userMapper")
public interface UserMapper extends BaseMapper<User> {

	/**
	 * 自定义注入方法
	 */
	int deleteAll();


	@Cacheable(key = "#p0")
	@Select("select id, name, create_time from sys_user where name =#{name}")
	public List<User> selectListBySQL(@Param("name") String name);

}